home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 07 - 1991 / 07.02 Feb 91 / 4th Debugger Appl / 4th Class.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-02-28  |  4.6 KB  |  114 lines  |  [TEXT/KAHL]

  1. /************************************************************************/
  2. /*                                                                      */
  3. /*    Include  - 4th Class.h                                                */
  4. /*    Author   - Alexander S. Colwell, Copyright © 1990                    */
  5. /*                                                                        */
  6. /*    Revision - None.                                                    */
  7. /*                                                                      */
  8. /************************************************************************/
  9.  
  10. #ifndef    _4thClass_                    /* Check if has not been included    */
  11. #define    _4thClass_                    /* Mark this file included            */
  12.  
  13.                                     /* Compilation parameters            */
  14. #define ExtArea                        /* Mark debugging external area        */
  15.  
  16.  
  17. #ifndef _4thDefs_                    /* Check if has not been included    */
  18. #include "4thDefs.h"                /* Include this file                */
  19. #endif
  20.  
  21. #include <oops.h>                    /* OOPS defs                        */
  22. #include <Color.h>                    /* Color defs                        */
  23.  
  24. #ifndef DbgExtArea                    /* Check if not debugging ext area    */
  25. #ifdef  ExtArea                        /* Check if it's real external area    */
  26. #include <SetupA4.h>                /* Setup Register A4 defs            */
  27. #define    DbgPrint        DummyProc    /* Dummy procedure                    */
  28.  
  29. #else                                /* Nope, we've debugging            */
  30. #define    main C4thMain                /* Re-define main entry procedure    */
  31. #define RememberA4()    DummyProc()
  32. #define RememberA0()    DummyProc()
  33. #define SetUpA4()        DummyProc()
  34. #define RestoreA4()        DummyProc()
  35. #define    DbgPrint        ((CDbgPane *)(gApplication->dbgDoc->itsMainPane))->DoPrint
  36. #endif
  37. #endif
  38.  
  39.                                     /* Trap definitions                    */
  40. #define    SysEnvironsTrap        0xa090    /* System Enviorment trap            */
  41. #define    GetDeviceListTrap    0xaa29    /* Graphics Device trap                */
  42. #define    UnknownTrap            0xa89f    /* Unknown trap instruction            */
  43.  
  44.                                     /* Mac ROM ID's                        */
  45. #define    macIIROM    0x0078            /* Mac II ROM ID                    */
  46. #define    macSEROM    0x0076            /* Mac SE ROM ID                    */
  47. #define    macPlusROM    0x0075            /* Mac Plus ROM ID                    */
  48. #define    macROM        0x0069            /* Original Mac ROM ID                */
  49.  
  50. extern RGBColor    HiliteRGB : 0xda0;    /* Hilite's RGB color                */
  51.  
  52. #ifndef NULL                        /* Check if "NULL" is not defined    */
  53. #define NULL    (0L)                /* Define "NULL" constant            */
  54. #endif
  55.  
  56.                                     /* Macro functions                    */
  57. #define    abs(a)        (a<0?-a:a)        /* Absolute value                    */
  58. #define    min(a,b)    (a<b?a:b)        /* Minimum value                    */
  59. #define    max(a,b)    (a<b?b:a)        /* Maximum value                    */
  60.  
  61. struct C4th : indirect {            /* 4th object data structure        */
  62.  
  63.                                     /* Variable instances                */
  64.     WindowPtr        wPtr;            /* External Area window pointer        */
  65.     short            layout;            /* Layout flag indicator            */
  66.     short            dirty;            /* Dirty flag indicator                */
  67.     short            active;            /* Active flag indicator            */
  68.     short            keyBoardEvents;    /* Using keyboard events            */
  69.     char            *name;            /* External area name string pointer*/
  70.     EventRecord        *event;            /* External area event pointer        */
  71.     Rect            drawArea;        /* External drawing area            */
  72.     Rect            prevArea;        /* Previous external drawing area    */
  73.     short            width;            /* External area width                */
  74.     short            height;            /* External area height                */
  75.  
  76.                                     /* System variable definitions        */
  77.     SysEnvRec        sysEnv;            /* System configuration                */
  78.     short            originalMac;    /* Using orignal 128K/512K Macs        */
  79.     short            hasGraphicDevices;/* Using graphic devices            */
  80.     
  81.                                     /* Working variable definitions        */
  82.     PenState        savePenState;    /* Save current pen states            */
  83.     short            saveFont;        /* Save current font's ID            */
  84.     short            saveSize;        /* Save current font's size            */
  85.     Style            saveStyle;        /* Save current font's style        */
  86.     short            saveMode;        /* Save current font's mode            */
  87.     RgnHandle        tmpRgn;            /* Temporary region                    */
  88.     
  89.                                     /* Method instances                    */
  90.     void            Message(void);    /* Dispatch message                  */
  91.     void            IExtArea(short);/* Initialization message            */
  92.     void            Close(void);    /* Close message                    */
  93.     void            Idle(void);        /* Idle message                        */
  94.     void            Cursor(Point);    /* Cursor message                    */
  95.     void            Select(void);    /* Activate message                    */
  96.     void            Deselect(void);    /* Deactivate message                */
  97.     void            Scroll(void);    /* Scroll message                    */
  98.     void            Draw(void);        /* Draw message                        */
  99.     void            DoClick(Point,short,long);/* Mouse message            */
  100.     void            DoKeyDown(char,Byte);/* Key message                    */
  101.     void            DoUndo(void);    /* Edit "Undo" message                */
  102.     void            DoCut(void);    /* Edit "Cut" message                */
  103.     void            DoCopy(void);    /* Edit "Copy" message                */
  104.     void            DoPaste(void);    /* Edit "Paste" message                */
  105.     void            DoClear(void);    /* Edit "Clear" message                */
  106.     void            DoSelectAll(void);/* Edit "Select All" message        */
  107.     void            SaveStates(void);/* Save drawing states                */
  108.     void            RestoreStates(void);/* Restore drawing states        */
  109.     short            TrackMouse(Point,RgnHandle);/* Track da mouse        */
  110.     short            UsingColor(void);/* Check if using color            */
  111.     };
  112.     
  113. #endif
  114.